import 'vue-tabs/vue-tabs.css'
import Vue from 'vue'
import VueTaber from 'vue-tabs'

import {
	menu
} from '@utils/config'

Vue.use(VueTaber)

let {
	MU_1,
	DE_2,
	SR_3,
	UA_4,
	MC_5,
	EM_6
} = menu

const tabs = [{
	// 首页
	name: "main",
	title: "首页",
	component: resolve => require(['@comp/main/main.vue'], resolve),
	beforeClose(tab, next) {},
	beforeCreate(tab, next) {
		console.log('before create:', tab)
			// console.log(this.$router.push('/home/de'))
		next()
	},
}, {
	// 物料上传
	name: MU_1.name,
	title: MU_1.text,
	component: resolve => require(['@comp/materalUpload/materalUpload.vue'], resolve),
	beforeClose(tab, next) {

		this.$confirm('此操作将不保存当前正在编辑的内容, 是否继续?', '提示', {
			confirmButtonText: '确定',
			cancelButtonText: '取消',
			type: 'warning'
		}).then(() => {
			next();
		}).catch(() => {

		});

		console.log(tab);
	},
	beforeCreate(tab, next) {
		console.log('before create:', tab)
		next()
	},
}, {
	// 数据编辑
	name: DE_2.name,
	title: DE_2.text,
	component: resolve => require(['@comp/dataEditor/dataEditor.vue'], resolve),
}]
export default new VueTaber({
	tabs,
	// persist: true,
})